import { Component, OnInit } from '@angular/core';
import {AlertService} from "../../../../services/alert.service";
import {AdminService} from "../../../../services/admin.service";
import {Searchlog} from "../../../../model/Searchlog";

@Component({
  selector: 'app-yhcxrz',
  templateUrl: './yhcxrz.component.html',
  styleUrls: ['./yhcxrz.component.css']
})
export class YhcxrzComponent implements OnInit {

  sl:Array<Searchlog>

  constructor(private adminService: AdminService,
              private alertService: AlertService) {
    this.sl = new Array()
  }

  ngOnInit(): void {
    this.getSearchlogs()
  }

  getSearchlogs(){
    this.adminService.getSearchlogs().then((data:any)=>{
      if(data.msg == "ok"){
        this.sl = data.list
      }else{
        this.alertService.showError("查询终端查询日志错误")
      }
    })
  }

}
